import {
  // BrowserRouter as Router,
  Router,
  Route,
  Redirect,
  Switch,
} from "react-router-dom";
import AuthRoute from "components/AuthRoute";
import Home from "pages/Layout";
import Login from "pages/Login";
import history from "utils/history";
// import { createBrowserHistory } from "history";
// const history = createBrowserHistory();
function App() {
  return (
    <Router history={history}>
      <div className="App">
        {/* 配置路由规则 */}
        <Switch>
          <Redirect exact from="/" to="home"></Redirect>
          <AuthRoute path="/home" component={Home}></AuthRoute>
          <Route path="/login" component={Login}></Route>
        </Switch>
      </div>
    </Router>
  );
}

export default App;
